<template>
  <a-card class="info" title="任务档案管理">
    <template slot="extra">
      <!--<a-button
          class="ruleButton"
          :ghost="true"
          type="primary"
          icon="edit"
          @click="handleEdit(model)"
          :disabled="isDisabledAuth('erpOmcContractManagerFinal:edit')"
      />-->
    </template>
    <a-row type="flex" justify="center">
      <a-col :span="24">
        <ErpOmcCTaskDistributionFileForm
          ref="realForm"
          :disabled="true"
          normal></ErpOmcCTaskDistributionFileForm>
      </a-col>
    </a-row>

    <ErpOmcCTaskDistributionFileModal ref="modalForm" @ok="modalFormOk"></ErpOmcCTaskDistributionFileModal>

    <!-- <a-row>
      <a-tabs :default-active-key="1">

        <a-tab-pane :key="1" tab="申请记录">
          <erp-omc-contract-manager-list2 ref="contractManagerList" :disabledButton="false"/>
        </a-tab-pane>
      </a-tabs>
    </a-row> -->

  </a-card>
</template>

<script>

import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ErpOmcCTaskDistributionFileForm from './modules/ErpOmcCTaskDistributionFileForm'
import ErpOmcCTaskDistributionFileModal from './modules/ErpOmcCTaskDistributionFileModal'
import { DisabledAuthFilterMixin } from '@/mixins/DisabledAuthFilterMixin'
// import ErpOmcContractManagerList2 from './ErpOmcContractManagerList2.vue'

export default {
  name: 'ErpOmcContractManagerFinalDetail',
  mixins: [JeecgListMixin, DisabledAuthFilterMixin],
  components: {
    ErpOmcCTaskDistributionFileForm,
    ErpOmcCTaskDistributionFileModal
    // ErpOmcContractManagerList2
  },
  props:{
    /* 当前传值的任务id */
    nowId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      model: {},
      id: '',
      url: {
        queryById: '/api/erp/omc/project/erpOmcProjectTaskFinal/queryPageList',
        delete: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/delete'
      },
      confirmLoading: false,
      iconStyle: { 'font-size': '20px' }
    }
  },
  watch: {
		nowId: {
			handler(val) {
				this.loadData()
			},
		},
	},
  mounted() {
    if(!this.nowId){
      this.loadData()
    }
  },
  methods: {
    loadData() {
      const id = this.$route.params.id || this.nowId;
      getAction(this.url.queryById, { id }).then((res) => {
        if (res.success) {
          const model = res.result
          this.$refs.realForm.edit(model);
          this.model = model;
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';

.info {
  /deep/ .ant-card-head-title {
    flex: none;
    margin-right: 20px;
  }

  /deep/ .ant-card-extra {
    flex: 1;
    float: left;
  }
}
</style>
